package com.example.instrumentationdemo;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void btnClick(View view) {
        EditText editText1 = findViewById(R.id.et1);
        EditText editText2 = findViewById(R.id.et2);
        TextView textView = findViewById(R.id.tv);
        textView.setText(Integer.parseInt(editText1.getText().toString())+Integer.parseInt(editText2.getText().toString())+"");
        Intent intent = new Intent(this,Main2Activity.class);
        startActivity(intent);
    }
}
